add_requires("onnxruntime 1.11.1")
add_includedirs("src", {public = true})
add_rules("mode.debug", "mode.release")

set_languages("c11", "cxx17")

target("Z2I")
    set_kind("static")
    add_files("src/*.cpp")
    add_packages("onnxruntime")
    add_rpathdirs("@loader_path", "@loader_path/lib", "@executable_path", "@executable_path/lib")
    -- add_defines("USE_CUDA")
    -- add_defines("USE_OPENVINO")
    -- add_defines("USE_TENSORRT")
    -- add_defines("USE_ROCM")

target("pbrain-Z2I")
    set_kind("binary")
    add_files("src/pbrain-Z2I/*.cpp")
    add_deps("Z2I")
    add_packages("onnxruntime")
    add_includedirs("$(scriptdir)/src/pbrain-Z2I/toml11/include")
    add_rpathdirs("@loader_path", "@loader_path/lib", "@executable_path", "@executable_path/lib")
    -- add_defines("USE_CUDA")
    -- add_defines("USE_OPENVINO")
    -- add_defines("USE_TENSORRT")
    -- add_defines("USE_ROCM")
    after_build(function (target)
        os.cp("$(scriptdir)/config/*.toml", target:targetdir())
    end)

target("train_and_eval")
    set_kind("binary")
    add_files("src/train_and_eval/*.cpp")
    add_deps("Z2I")
    add_packages("onnxruntime")
    add_rpathdirs("@loader_path", "@loader_path/lib", "@executable_path", "@executable_path/lib")
    -- add_defines("USE_CUDA")
    -- add_defines("USE_OPENVINO")
    -- add_defines("USE_TENSORRT")
    -- add_defines("USE_ROCM")
